//
//  LoadViewController.swift
//  OnemeetingDemo
//
//  Created by 张衡 on 2019/12/23.
//  Copyright © 2019 www.onemeeting.1meetingIos. All rights reserved.
//

import Foundation
import AyLoading

class LoadViewController: BaseViewController {
    
    static let shared = LoadViewController()
    override func loadView() {
        let view = NSView.init(frame: NSMakeRect(0, 0, 160, 150))
        view.wantsLayer = true
        view.layer?.backgroundColor = NSColor.white.cgColor
        self.view = view
    }
    
    public class func show() {
        let window = BaseWindow()
        window.styleMask = [.fullSizeContentView,.titled]
        window.contentViewController = LoadViewController.shared
      
        let windowC = NSWindowController()
        windowC.window = window
        windowC.window?.orderFront(nil)
    }
    
    public class func dismss() {
        LoadViewController.shared.view.window?.close()
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        setupUI()
    }
    
    func setupUI() {
        self.view.ay.startLoading(message: "加载中".localized())
    }
}
